{$CLEO .qa}
{$USE CLEO+}
{$USE newOpcodes}
{$USE ini}

0000: NOP

script_name "RRepair"

// By ArtemQa146

const
    Car_Actor = 0@
    Mechanic = 31@
    Spanner = 30@
    Drill = 29@
    Sponge = 28@
    Procces = 27@
    Spray = 26@
    MONEY_COLOR = 21@
    MONEY_WASH = 20@
    MONEY_REPAIR = 19@
    MONEY_TIRE = 18@
    GasPetrol = 16@
    panel_1 = 15@
    panel_active_row = 17@
    money_full = 25@
    money_body = 23@
    UI_SIZE = 200.0
    UI_X = 405.0
    UI_Y = 130.0
    TEXT_Y = 300.0
    MESSAGE_TIME = 1300
end

while true
    wait 0
        if
            Player.Defined(0)
        then
            if or
                0@ == true
                0@ == 146 // Phone mod
            then
                if 0@ == true
                then 4@ = true
                else 4@ = false
                end
                5@ = false
                
                0087: 22@ = 1@ // (float)
                Car_Actor = Actor.CurrentCar($PLAYER_ACTOR)
                
                6@ = 0
                
                0441: 1@ = car Car_Actor model
                0AD3: 7@v = string_format "%d" 1@
                0AF0: 6@ = get_int_from_ini_file "CLEO\Rural car repairs.ini" section "Car Exception" key 7@v
                
                0E12: get_vehicle Car_Actor subclass_to 1@
                0E40: get_current_hour 2@
                
                if
                    4@ == true
                then
                    if and
                        2@ >= 6
                        not 6@ == 1
                        1@ == 0
                        810F:   not player $PLAYER_CHAR wanted_level > 0
                    then
                        5@ = true
                    end
                else
                    if and
                        1@ == 0
                        not 6@ == 1
                    then
                        5@ = true
                    end
                end
                
                    if 
                        5@ == true
                    then
                        016A: fade 0 time 300
                        wait 300
                        01B4: set_player $PLAYER_CHAR can_move 0
                        7@ = 2.5 //  
                        0ABF: set_car Car_Actor engine_state_to 0
                        0175: set_car Car_Actor Z_angle_to 22@
                        22@ = 0
                        //   
                        repeat 
                        wait 0
                        0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 7@ 0.0
                        0407: store_coords_to 4@ 5@ 6@ from_car Car_Actor with_offset 0.0 1.0 0.0
                            if
                                86BD:   no_obstacles_between 1@ 2@ 3@ and 4@ 5@ 6@ solid 0 car 1 actor 0 object 0 particle 0
                            then
                                7@ += 0.4
                                break
                            else
                                7@ += 0.1
                            end
                        until timera > 2000
                        //     
                        0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 2.0 7@ 1.0
                        model.Load(50)
                        model.Load(365)
                        038B: load_requested_models
                        009A: Mechanic = create_actor_pedtype 4 model 50 at 1@ 2@ 3@
                        0174: 1@ = car Car_Actor Z_angle
                        1@ += 90.0
                        0173: set_actor Mechanic Z_angle_to 1@
                        0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                        model.Destroy(50)
                        0619: enable_actor Mechanic collision_detection 0
                        
                        0E2E: create_render_object_to_char_bone Mechanic model 365 bone 24 offset 0 0 0 rotation 0 0 0 store_to Spray
                        0AF0: 1@ = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Models" key "Spanner"
                        0F02: create_render_object_to_char_bone_from_special Mechanic special_model 1@ bone 24 offset 0 0 0 rotation 0 0 0 store_to Spanner
                        0AF0: 1@ = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Models" key "Sponge"
                        0F02: create_render_object_to_char_bone_from_special Mechanic special_model 1@ bone 24 offset 0 0.05 0 rotation 0 0 0 store_to Sponge
                        0AF0: 1@ = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Models" key "Drill"
                        0F02: create_render_object_to_char_bone_from_special Mechanic special_model 1@ bone 24 offset 0 0 0 rotation 0 0 0 store_to Drill
                        0AF0: 1@ = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Models" key "GasPetrol"
                        0F02: create_render_object_to_char_bone_from_special Mechanic special_model 1@ bone 24 offset 0 0 0 rotation 0.0 15.0 0 store_to GasPetrol
                        0E31: set_render_object_visible Spanner 0
                        0E31: set_render_object_visible Sponge 0
                        0E31: set_render_object_visible Drill 0
                        0E31: set_render_object_visible Spray 0
                        0E31: set_render_object_visible GasPetrol 0

                        0AF0: MONEY_COLOR = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Settings" key "Money Color"
                        0AF0: MONEY_WASH = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Settings" key "Money Wash"
                        0AF0: MONEY_REPAIR = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Settings" key "Money Repair Engine"
                        0AF0: MONEY_TIRE = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Settings" key "Money Repair Tire"
                        0AF0: money_full = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Settings" key "Money Full Repair"
                        0AF0: money_body = read_int_from_ini_file "cleo\Rural car repairs.ini" section "Settings" key "Money Body"

                        Procces = -1

                        03BF: set_player $PLAYER_CHAR ignored_by_everyone 1
                        0826: enable_hud 0
                        0581: enable_radar 0
                        0087: 8@ = 7@ // (float)
                        8@ += 4.0 //  
                        0679: put_camera_on_car Car_Actor with_offset -2.0 8@ 1.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                        wait 100
                        068D: get_camera_position_to 1@ 2@ 3@
                        0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset -2.0 4@ 1.0
                        015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                        0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 0.0 0.0
                        0160: set_camera_point_at 1@ 2@ 3@ switchstyle 1
                        wait 100
                        0679: put_camera_on_car Car_Actor with_offset -2.0 8@ 1.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                        
                        repeat
                        wait 0
                        04ED: load_animation  "RuralRepair"
                        until 04EE:   animation "RuralRepair" loaded
                        0812: AS_actor Mechanic perform_animation "Washer_Idle" IFP "RuralRepair" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                        wait 400
                        016A: fade 1 time 300
                        
                        //   ,      
                        051E: 1@ = get_current_radio_station
                        if
                            1@ == 12
                        then
                            0209: 1@ = random_int_in_ranges 1 11
                            041E: set_radio_station 1@
                            0209: 1@ = random_int_in_ranges 1 5
                                if 1@ == 1
                            then
                                00BC: show_text_highpriority GXT 'rpcar4' time 3000 flag 1
                            end
                                if 1@ == 2
                            then
                                00BC: show_text_highpriority GXT 'rpcar15' time 3000 flag 1
                            end
                                if 1@ == 3
                            then
                                00BC: show_text_highpriority GXT 'rpcar16' time 3000 flag 1
                            end
                                if 1@ == 4
                            then
                                00BC: show_text_highpriority GXT 'rpcar17' time 3000 flag 1
                            end
                        end
                        
                        gosub @panel_1
                    

                //  
                repeat
                wait 0
                if and
                    056D:   actor Mechanic defined
                    056E:   car Car_Actor defined
                then
                    if or
                        0118:   actor $PLAYER_ACTOR dead
                        0118:   actor Mechanic dead
                        0741:   actor $PLAYER_ACTOR busted
                        not Actor.Driving($PLAYER_ACTOR)
                        80DB:   not actor $PLAYER_ACTOR in_car Car_Actor
                        0119:   car Car_Actor wrecked
                    then
                        break
                    end

                    // 
                    0342: set_text_draw_centered 1
                    0348: enable_text_draw_proportional 1
                    0349: set_text_draw_font 1
                    060D: draw_text_shadow 0 rgba 0 0 0 0
                    081C: draw_text_outline 1 RGBA 0 0 0 255

                    08D7: Panel_active_row = panel Panel_1 active_row
                    
                    
                    //   
                    if or
                        Procces == 300
                        Procces == 301
                    then
                    1@ = 515.0
                    2@ = 110.0
                        if
                            Procces == 300
                        then
                            045A: draw_text_1number 1@ 2@ GXT 'rpcar' number 11@  //  
                            03F0: enable_text_draw 1
                        else
                            045A: draw_text_1number 1@ 2@ GXT 'rpcar7' number 11@  //  
                            03F0: enable_text_draw 1
                        end
                    end
                    
                    
                            //  -----------------------------------------------------------
                            if and
                                Procces == -1
                                00E1:   player 0 pressed_key 15
                            then
                                016A: fade 0 time 300
                                wait 300
                                break
                            end
                            
                            //    -----------------------------------------------------------
                            
                            //  -----------------------------------------------------------
                            if and
                                Procces == -1
                                00E1:   player 0 pressed_key 16
                                Panel_active_row == 0
                            then
                                if or
                                    0496:   tire 0 on_car Car_Actor deflated
                                    0496:   tire 1 on_car Car_Actor deflated
                                    0496:   tire 2 on_car Car_Actor deflated
                                    0496:   tire 3 on_car Car_Actor deflated
                                then
                                    if
                                        010A:   player $PLAYER_CHAR money > MONEY_TIRE
                                    then
                                        0A97: 1@ = car Car_Actor struct
                                        0A8E: 2@ = 1@ + 0x18
                                        0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
                                        0AA7: call_function 0x4C5400 num_params 2 pop 2 "wheel_lb_dummy" 2@ 10@
                                        0AA7: call_function 0x4C5400 num_params 2 pop 2 "wheel_rf_dummy" 2@ 11@
                                        if and
                                            10@ <> 0 // "wheel_lb_dummy"
                                            11@ <> 0 // "wheel_rf_dummy"
                                        then
                                            0D4E: 1@ = read_struct 10@ offset 0x40 size 4
                                            0D4E: 2@ = read_struct 10@ offset 0x44 size 4
                                            0D4E: 3@ = read_struct 10@ offset 0x48 size 4

                                            1@ -= 1.2
                                            0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 1@ 2@ 3@

                                            0D4E: 4@ = read_struct 11@ offset 0x40 size 4
                                            0D4E: 5@ = read_struct 11@ offset 0x44 size 4
                                            0D4E: 6@ = read_struct 11@ offset 0x48 size 4

                                            4@ += 0.8
                                            0407: store_coords_to 4@ 5@ 6@ from_car Car_Actor with_offset 4@ 5@ 6@
                                            Procces = 100
                                            timerb = 0
                                            0E31: set_render_object_visible Drill 1
                                            0085: 10@ = MONEY_TIRE // (int)
                                            10@ *= -1
                                            0109: player $PLAYER_CHAR money += 10@
                                            08DA: remove_panel panel_1
                                            03E6: remove_text_box
                                        else
                                            0AD1: show_formatted_text_highpriority "Component not detected: wheel_lb_dummy or wheel_rf_dummy" time 2000
                                        end
                                    else
                                        00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                    end
                                else
                                    00BC: show_text_highpriority GXT 'rpcar60' time 2000 flag 1
                                end
                            end
                                
                            if
                                Procces == 100
                            then
                                016A: fade 0 time 300
                                wait 300
                                0792: disembark_instantly_actor Mechanic
                                3@ += 0.5
                                00A1: put_actor Mechanic at 1@ 2@ 3@
                                0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                0174: 10@ = car Car_Actor Z_angle
                                10@ -= 90.0
                                0173: set_actor Mechanic Z_angle_to 10@
                                0812: AS_actor Mechanic perform_animation "Repair_tire" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                067C: put_camera_on_actor Mechanic offset -3.0 -1.5 0.0 rotation 0.0 1.0 0.0 tilt 0.0 switchstyle 2
                                Procces = 101
                                wait 100
                                016A: fade 1 time 300
                                timerb = 0
                            end

                            if and
                                Procces >= 101
                                Actor.Animation(Mechanic) == "Repair_tire"
                            then
                                0613: 10@ = actor Mechanic animation "Repair_tire" time
                                if and
                                    Procces == 101
                                    10@ > 0.5
                                then
                                    067C: put_camera_on_actor Mechanic offset 2.0 -0.8 0.0 rotation 0.0 1.0 -0.5 tilt 0.0 switchstyle 2
                                    Procces = 102
                                end
                                if and
                                    Procces == 102
                                    10@ > 0.9
                                then
                                    6@ += 0.5
                                    00A1: put_actor Mechanic at 4@ 5@ 6@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 10@ = car Car_Actor Z_angle
                                    10@ += 90.0
                                    0173: set_actor Mechanic Z_angle_to 10@
                                    0812: AS_actor Mechanic perform_animation "Service_work" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    067C: put_camera_on_actor Mechanic offset 3.0 -1.0 1.0 rotation 0.0 1.0 -0.5 tilt 0.0 switchstyle 2
                                    0E31: set_render_object_visible Drill 0
                                    0E31: set_render_object_visible Spanner 1
                                    Procces = 103
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 103
                                Actor.Animation(Mechanic) == "Service_work"
                            then
                                0613: 10@ = actor Mechanic animation "Service_work" time
                                if
                                    10@ > 0.9
                                then
                                    0812: AS_actor Mechanic perform_animation "Service_head" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    067C: put_camera_on_actor Mechanic offset -2.0 -0.0 0.0 rotation 0.0 0.0 -0.5 tilt 0.0 switchstyle 2
                                    Procces = 104
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 104
                                Actor.Animation(Mechanic) == "Service_head"
                            then
                                0613: 10@ = actor Mechanic animation "Service_head" time
                                if
                                    10@ > 0.9
                                then
                                    016A: fade 0 time 300
                                    wait 300
                                    0699: set_car Car_Actor repair_tire 0
                                    0699: set_car Car_Actor repair_tire 1
                                    0699: set_car Car_Actor repair_tire 2
                                    0699: set_car Car_Actor repair_tire 3
                                    timerb = 0
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar11' time 3000 flag 1
                                end
                            end


                            //  -----------------------------------------------------------
                            if and
                                Procces == -1
                                Panel_active_row == 1
                                00E1:   player 0 pressed_key 16
                            then
                                if
                                    8185:   not car Car_Actor health > 950
                                then
                                    if
                                        010A:   player $PLAYER_CHAR money > MONEY_REPAIR
                                    then
                                        0A97: 1@ = car Car_Actor struct
                                        0A8E: 2@ = 1@ + 0x18
                                        0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
                                        0AA7: call_function 0x4C5400 num_params 2 pop 2 "bonnet_dummy" 2@ 10@
                                        if
                                            10@ <> 0 // "wheel_lf_dummy"
                                        then
                                            016A: fade 0 time 300
                                            wait 300

                                            10@ += 16
                                            9@ = 0.5 // 
                                            timera = 0
                                            0085: 1@ = MONEY_REPAIR // (int)
                                            1@ *= -1
                                            0109: player $PLAYER_CHAR money += 1@

                                            0441: 1@ = car Car_Actor model
                                            07E4: get_model 1@ dimensions_cornerA_to 2@ 2@ 2@ dimensions_cornerB_to 2@ 9@ 2@ // B
                                            9@ += 0.3
                                            0792: disembark_instantly_actor Mechanic
                                            0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 9@ 0.5
                                            00A1: put_actor Mechanic at 1@ 2@ 3@
                                            0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                            0174: 1@ = car Car_Actor Z_angle
                                            1@ -= 180.0
                                            0173: set_actor Mechanic Z_angle_to 1@
                                            0812: AS_actor Mechanic perform_animation "boot_open" IFP "RuralRepair" framedelta 10.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1
                                            0087: 1@ = 9@ // (float)
                                            1@ -= 3.0
                                            067C: put_camera_on_actor Mechanic offset -3.0 -0.0 0.5 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                            Procces = 200
                                            08DA: remove_panel panel_1
                                            03E6: remove_text_box
                                            wait 100
                                            016A: fade 1 time 300
                                            timerb = 0
                                        else
                                            0AD1: show_formatted_text_highpriority "Component not detected: bonnet_dummy" time 2000
                                        end
                                    else
                                        00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                    end
                                else
                                    00BC: show_text_highpriority GXT 'rpcar62' time 2000 flag 1
                                end
                            end
                            
                            if and
                                Procces == 200
                                Actor.Animation(Mechanic) == "boot_open"
                            then
                                0613: 1@ = actor Mechanic animation "boot_open" time
                                08A6: set_car Car_Actor door 0 rotation_to 1@
                                if
                                    1@ > 0.9
                                then
                                    067C: put_camera_on_actor Mechanic offset -2.0 -0.0 0.5 rotation 0.0 1.5 0.0 tilt 0.0 switchstyle 2
                                    0812: AS_actor Mechanic perform_animation "boot_idles" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    0E31: set_render_object_visible Spanner 1
                                    Procces = 201
                                    wait 100
                                    timerb = 0
                                end
                            end
                            
                            if and
                                Procces == 201
                                Actor.Animation(Mechanic) == "boot_idles"
                            then
                                0613: 1@ = actor Mechanic animation "boot_idles" time
                                if
                                    1@ > 0.9
                                then
                                    0614: set_actor Mechanic animation "boot_idles" progress_to 0.1 // 0.0 to 1.0
                                    Procces = 202
                                    067C: put_camera_on_actor Mechanic offset 2.0 1.0 0.7 rotation 0.0 1.5 0.0 tilt 0.0 switchstyle 2
                                    wait 100
                                    timerb = 0
                                end
                            end
                                
                            if and
                                Procces == 202
                                Actor.Animation(Mechanic) == "boot_idles"
                            then
                                0613: 1@ = actor Mechanic animation "boot_idles" time
                                if
                                    1@ > 0.9
                                then
                                    0812: AS_actor Mechanic perform_animation "boot_close" IFP "RuralRepair" framedelta 10.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1
                                    Procces = 203
                                    067C: put_camera_on_actor Mechanic offset 3.0 -0.0 0.5 rotation 0.0 0.5 0.0 tilt 0.0 switchstyle 2
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 203
                                Actor.Animation(Mechanic) == "boot_close"
                            then
                                0393: actor Mechanic perform_animation "boot_close" at 0.8 times_normal_rate
                                0613: 1@ = actor Mechanic animation "boot_close" time
                                2@ = 1.0
                                0063: 2@ -= 1@  // (float)
                                08A6: set_car Car_Actor door 0 rotation_to 2@
                                if
                                    1@ > 0.95
                                then
                                    08A6: set_car Car_Actor door 0 rotation_to 0.0
                                    wait 100
                                    016A: fade 0 time 300
                                    wait 300
                                    0224: set_car Car_Actor health_to 1000
                                    timerb = 0
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar12' time 3000 flag 1
                                end
                            end
                            
                            // 
                            if and
                                Procces == -1
                                00E1:   player 0 pressed_key 16
                                Panel_active_row == 2
                            then
                                if
                                    03C9:   car Car_Actor damaged
                                then
                                    if
                                        010A:   player $PLAYER_CHAR money > money_body
                                    then
                                        016A: fade 0 time 300
                                        wait 300

                                        9@ = -0.1 //  
                                        timera = 0
                                        0085: 1@ = money_body // (int)
                                        1@ *= -1
                                        0109: player $PLAYER_CHAR money += 1@

                                        0441: 1@ = car Car_Actor model
                                        07E4: get_model 1@ dimensions_cornerA_to 9@ 2@ 2@ dimensions_cornerB_to 2@ 2@ 2@ // B
                                        9@ -= 0.85
                                        0792: disembark_instantly_actor Mechanic
                                        0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 9@ 0.0 0.5
                                        00A1: put_actor Mechanic at 1@ 2@ 3@
                                        0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                        0174: 1@ = car Car_Actor Z_angle
                                        1@ -= 90.0
                                        0173: set_actor Mechanic Z_angle_to 1@
                                        0812: AS_actor Mechanic perform_animation "Repair_tire" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                        0E31: set_render_object_visible drill 1
                                        0087: 1@ = 9@ // (float)
                                        1@ -= 2.0
                                        067C: put_camera_on_actor Mechanic offset 3.0 -1.0 0.0 rotation 0.0 1.0 0.0 tilt 0.0 switchstyle 2
                                        Procces = 2000
                                        08DA: remove_panel panel_1
                                        03E6: remove_text_box
                                        wait 100
                                        016A: fade 1 time 300
                                        timerb = 0
                                    else
                                        00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                    end
                                else
                                    00BC: show_text_highpriority GXT 'rpcar65' time 2000 flag 1
                                end
                            end

                            if and
                                Procces == 2000
                                Actor.Animation(Mechanic) == "Repair_tire"
                            then
                                0613: 1@ = actor Mechanic animation "Repair_tire" time
                                if
                                    1@ > 0.8
                                then
                                    0441: 1@ = car Car_Actor model
                                    07E4: get_model 1@ dimensions_cornerA_to 2@ 9@ 2@ dimensions_cornerB_to 2@ 2@ 2@ // B
                                    9@ -= 0.7
                                    0792: disembark_instantly_actor Mechanic
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 9@ 0.5
                                    00A1: put_actor Mechanic at 1@ 2@ 3@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 1@ = car Car_Actor Z_angle
                                    0173: set_actor Mechanic Z_angle_to 1@
                                    0812: AS_actor Mechanic perform_animation "Service_work" IFP "RuralRepair" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    9@ += 1.0
                                    067C: put_camera_on_actor Mechanic offset 2.0 -1.0 0.0 rotation 0.0 0.5 0.0 tilt 0.0 switchstyle 2
                                    Procces = 2001
                                    0E31: set_render_object_visible drill 0
                                    0E31: set_render_object_visible Spanner 1
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 2001
                                Actor.Animation(Mechanic) == "Service_work"
                            then
                                0613: 1@ = actor Mechanic animation "Service_work" time
                                if
                                    1@ > 0.8
                                then
                                    Procces = 2002
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 2002
                                Actor.Animation(Mechanic) == "Service_work"
                            then
                                0613: 1@ = actor Mechanic animation "Service_work" time
                                if
                                    1@ > 0.8
                                then
                                    016A: fade 0 time 300
                                    wait 300
                                    0A97: 1@ = vehicle Car_Actor struct
                                    068A: set_car Car_Actor repair_door 0
                                    068A: set_car Car_Actor repair_door 1
                                    068A: set_car Car_Actor repair_door 2
                                    068A: set_car Car_Actor repair_door 3
                                    068A: set_car Car_Actor repair_door 4
                                    068A: set_car Car_Actor repair_door 5
                                    0698: set_car Car_Actor repair_componentB 0
                                    0698: set_car Car_Actor repair_componentB 1
                                    0698: set_car Car_Actor repair_componentB 4
                                    0698: set_car Car_Actor repair_componentB 5
                                    0698: set_car Car_Actor repair_componentB 6
                                    0D4E: 2@ = struct 1@ offset 0x42A size 4
                                    08C3: clear 2@ bit 0
                                    0E28: write_struct 1@ offset 0x42A size 4 value 2@
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar33' time 3000 flag 1
                                    timerb = 0
                                end
                            end
                            
                            // 
                            if and
                                Procces == -1
                                00E1:   player 0 pressed_key 16
                                Panel_active_row == 3
                            then
                                if or
                                    8185:   not car Car_Actor health > 950
                                    03C9:   car Car_Actor damaged
                                    0496:   tire 0 on_car Car_Actor deflated
                                    0496:   tire 1 on_car Car_Actor deflated
                                    0496:   tire 2 on_car Car_Actor deflated
                                    0496:   tire 3 on_car Car_Actor deflated
                                then
                                    if
                                        010A:   player $PLAYER_CHAR money > money_full
                                    then
                                        0A97: 1@ = car Car_Actor struct
                                        0A8E: 2@ = 1@ + 0x18
                                        0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
                                        0AA7: call_function 0x4C5400 num_params 2 pop 2 "wheel_lb_dummy" 2@ 10@
                                        0AA7: call_function 0x4C5400 num_params 2 pop 2 "wheel_rf_dummy" 2@ 11@
                                        0AA7: call_function 0x4C5400 num_params 2 pop 2 "bonnet_dummy" 2@ 12@
                                        if and
                                            10@ <> 0 // "wheel_lb_dummy"
                                            11@ <> 0 // "wheel_rf_dummy"
                                            12@ <> 0
                                        then
                                            0D4E: 1@ = read_struct 10@ offset 0x40 size 4
                                            0D4E: 2@ = read_struct 10@ offset 0x44 size 4
                                            0D4E: 3@ = read_struct 10@ offset 0x48 size 4

                                            1@ -= 1.2
                                            0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 1@ 2@ 3@

                                            0D4E: 4@ = read_struct 11@ offset 0x40 size 4
                                            0D4E: 5@ = read_struct 11@ offset 0x44 size 4
                                            0D4E: 6@ = read_struct 11@ offset 0x48 size 4

                                            4@ += 0.8
                                            0407: store_coords_to 4@ 5@ 6@ from_car Car_Actor with_offset 4@ 5@ 6@
                                            Procces = 910
                                            timerb = 0
                                            0E31: set_render_object_visible Drill 1
                                            0085: 10@ = money_full // (int)
                                            10@ *= -1
                                            0109: player $PLAYER_CHAR money += 10@
                                            08DA: remove_panel panel_1
                                            03E6: remove_text_box
                                        else
                                            0AD1: show_formatted_text_highpriority "Component not detected: wheel_lb_dummy or wheel_rf_dummy" time 2000
                                        end
                                    else
                                        00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                    end
                                else
                                    00BC: show_text_highpriority GXT 'rpcar61' time 2000 flag 1
                                end
                            end

                            if
                                Procces == 910
                            then
                                016A: fade 0 time 300
                                wait 300

                                0792: disembark_instantly_actor Mechanic
                                3@ += 0.5
                                00A1: put_actor Mechanic at 1@ 2@ 3@
                                0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                0174: 10@ = car Car_Actor Z_angle
                                10@ -= 90.0
                                0173: set_actor Mechanic Z_angle_to 10@
                                0812: AS_actor Mechanic perform_animation "Repair_tire" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                067C: put_camera_on_actor Mechanic offset -3.0 -1.5 0.0 rotation 0.0 1.0 0.0 tilt 0.0 switchstyle 2
                                Procces = 911
                                wait 100
                                016A: fade 1 time 300
                                timerb = 0
                            end

                            if and
                                Procces >= 911
                                Actor.Animation(Mechanic) == "Repair_tire"
                            then
                                0613: 10@ = actor Mechanic animation "Repair_tire" time
                                if and
                                    Procces == 911
                                    10@ > 0.45
                                then
                                    067C: put_camera_on_actor Mechanic offset 2.0 -0.8 0.0 rotation 0.0 1.0 -0.5 tilt 0.0 switchstyle 2
                                    Procces = 912
                                end
                            end

                            if and
                                Procces >= 912
                                Actor.Animation(Mechanic) == "Repair_tire"
                            then
                                0613: 10@ = actor Mechanic animation "Repair_tire" time
                                if and
                                    Procces == 912
                                    10@ > 0.9
                                then
                                    Procces = 913
                                    0E31: set_render_object_visible Drill 0
                                end
                            end


                            if
                                Procces == 913
                            then
                                0A97: 1@ = car Car_Actor struct
                                0A8E: 2@ = 1@ + 0x18
                                0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
                                0AA7: call_function 0x4C5400 num_params 2 pop 2 "bonnet_dummy" 2@ 10@
                                if
                                    10@ <> 0 // "wheel_lf_dummy"
                                then
                                    10@ += 16
                                    9@ = 0.5 // 
                                    timera = 0

                                    0441: 1@ = car Car_Actor model
                                    07E4: get_model 1@ dimensions_cornerA_to 2@ 2@ 2@ dimensions_cornerB_to 2@ 9@ 2@ // B
                                    9@ += 0.3
                                    0792: disembark_instantly_actor Mechanic
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 9@ 0.5
                                    00A1: put_actor Mechanic at 1@ 2@ 3@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 1@ = car Car_Actor Z_angle
                                    1@ -= 180.0
                                    0173: set_actor Mechanic Z_angle_to 1@
                                    0812: AS_actor Mechanic perform_animation "boot_open" IFP "RuralRepair" framedelta 10.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1
                                    0087: 1@ = 9@ // (float)
                                    1@ -= 3.0
                                    067C: put_camera_on_actor Mechanic offset -3.0 -0.0 0.5 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                    Procces = 914
                                    08DA: remove_panel panel_1
                                    03E6: remove_text_box
                                    wait 100
                                    timerb = 0
                                else
                                    0AD1: show_formatted_text_highpriority "Component not detected: bonnet_dummy" time 2000
                                end
                            end

                            if and
                                Procces == 914
                                Actor.Animation(Mechanic) == "boot_open"
                            then
                                0613: 1@ = actor Mechanic animation "boot_open" time
                                08A6: set_car Car_Actor door 0 rotation_to 1@
                                if
                                    1@ > 0.9
                                then
                                    067C: put_camera_on_actor Mechanic offset -2.0 -0.0 0.5 rotation 0.0 1.5 0.0 tilt 0.0 switchstyle 2
                                    0812: AS_actor Mechanic perform_animation "boot_idles" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    0E31: set_render_object_visible Spanner 1
                                    Procces = 915
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 915
                                Actor.Animation(Mechanic) == "boot_idles"
                            then
                                0613: 1@ = actor Mechanic animation "boot_idles" time
                                if
                                    1@ > 0.9
                                then
                                    0614: set_actor Mechanic animation "boot_idles" progress_to 0.1 // 0.0 to 1.0
                                    Procces = 916
                                    067C: put_camera_on_actor Mechanic offset 2.0 -3.2 0.7 rotation 0.0 1.5 0.0 tilt 0.0 switchstyle 2
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 916
                                Actor.Animation(Mechanic) == "boot_idles"
                            then
                                0613: 1@ = actor Mechanic animation "boot_idles" time
                                if
                                    1@ > 0.9
                                then
                                    0812: AS_actor Mechanic perform_animation "boot_close" IFP "RuralRepair" framedelta 10.0 loopA 0 lockX 0 lockY 0 lockF 1 time -1
                                    Procces = 917
                                    067C: put_camera_on_actor Mechanic offset 3.0 -0.0 0.5 rotation 0.0 0.5 0.0 tilt 0.0 switchstyle 2
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 917
                                Actor.Animation(Mechanic) == "boot_close"
                            then
                                0393: actor Mechanic perform_animation "boot_close" at 0.8 times_normal_rate
                                0613: 1@ = actor Mechanic animation "boot_close" time
                                2@ = 1.0
                                0063: 2@ -= 1@  // (float)
                                08A6: set_car Car_Actor door 0 rotation_to 2@
                                if
                                    1@ > 0.95
                                then
                                    0441: 1@ = car Car_Actor model
                                    07E4: get_model 1@ dimensions_cornerA_to 2@ 9@ 2@ dimensions_cornerB_to 2@ 2@ 2@ // B
                                    9@ -= 0.7
                                    0792: disembark_instantly_actor Mechanic
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 9@ 0.5
                                    00A1: put_actor Mechanic at 1@ 2@ 3@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 1@ = car Car_Actor Z_angle
                                    
                                    0173: set_actor Mechanic Z_angle_to 1@
                                    0812: AS_actor Mechanic perform_animation "Service_work" IFP "RuralRepair" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    9@ += 1.0
                                    067C: put_camera_on_actor Mechanic offset 2.0 -1.0 0.0 rotation 0.0 0.5 0.0 tilt 0.0 switchstyle 2
                                    Procces = 918
                                    0E31: set_render_object_visible drill 0
                                    0E31: set_render_object_visible Spanner 1
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 918
                                Actor.Animation(Mechanic) == "Service_work"
                            then
                                0613: 1@ = actor Mechanic animation "Service_work" time
                                if
                                    1@ > 0.8
                                then
                                    Procces = 919
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 919
                                Actor.Animation(Mechanic) == "Service_work"
                            then
                                0613: 1@ = actor Mechanic animation "Service_work" time
                                if
                                    1@ > 0.8
                                then
                                    016A: fade 0 time 300
                                    wait 300
                                    0A30: repair_car Car_Actor
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar6' time 3000 flag 1
                                    timerb = 0
                                end
                            end


                            
                            //   -----------------------------------------------------------
                            if and
                                Procces == -1
                                Panel_active_row == 4
                                00E1:   player 0 pressed_key 16
                            then
                                if
                                    010A:   player $PLAYER_CHAR money > MONEY_WASH
                                then
                                    016A: fade 0 time 300
                                    wait 300

                                    9@ = -0.1 //  
                                    timera = 0
                                    0085: 1@ = MONEY_WASH // (int)
                                    1@ *= -1
                                    0109: player $PLAYER_CHAR money += 1@

                                    0441: 1@ = car Car_Actor model
                                    07E4: get_model 1@ dimensions_cornerA_to 9@ 2@ 2@ dimensions_cornerB_to 2@ 2@ 2@ // B
                                    9@ -= 0.3
                                    0792: disembark_instantly_actor Mechanic
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 9@ 0.0 0.5
                                    00A1: put_actor Mechanic at 1@ 2@ 3@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 1@ = car Car_Actor Z_angle
                                    1@ -= 90.0
                                    0173: set_actor Mechanic Z_angle_to 1@
                                    0812: AS_actor Mechanic perform_animation "Car_wash" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    0E31: set_render_object_visible Sponge 1
                                    0087: 1@ = 9@ // (float)
                                    1@ -= 3.0
                                    0679: put_camera_on_car Car_Actor with_offset 1@ -2.0 1.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                    Procces = 0
                                    08DA: remove_panel panel_1
                                    03E6: remove_text_box
                                    wait 100
                                    016A: fade 1 time 300
                                    timerb = 0
                                else
                                    00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                end
                            end

                            if and
                                Procces == 0
                                Actor.Animation(Mechanic) == "Car_wash"
                            then
                                0613: 1@ = actor Mechanic animation "Car_wash" time
                                if
                                    1@ > 0.8
                                then
                                    0792: disembark_instantly_actor Mechanic
                                    9@ *= -1.0
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 9@ 0.0 0.5
                                    00A1: put_actor Mechanic at 1@ 2@ 3@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 1@ = car Car_Actor Z_angle
                                    1@ += 90.0
                                    0173: set_actor Mechanic Z_angle_to 1@
                                    0812: AS_actor Mechanic perform_animation "Car_wash" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    0614: set_actor Mechanic animation "Car_wash" progress_to 0.1 // 0.0 to 1.0
                                    9@ += 1.0
                                    0679: put_camera_on_car Car_Actor with_offset 9@ 3.0 0.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                    Procces = 1
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 1
                                Actor.Animation(Mechanic) == "Car_wash"
                            then
                                0613: 1@ = actor Mechanic animation "Car_wash" time
                                if
                                    1@ > 0.8
                                then
                                    0614: set_actor Mechanic animation "Car_wash" progress_to 0.1 // 0.0 to 1.0
                                    0679: put_camera_on_car Car_Actor with_offset 9@ -3.0 0.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                    Procces = 2
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 2
                                Actor.Animation(Mechanic) == "Car_wash"
                            then
                                0613: 1@ = actor Mechanic animation "Car_wash" time
                                if
                                    1@ > 0.9
                                then
                                    0812: AS_actor Mechanic perform_animation "Car_wash_stay" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    0679: put_camera_on_car Car_Actor with_offset 9@ 5.0 1.4 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                    Procces = 3
                                    wait 100
                                    timerb = 0
                                end
                            end

                            if and
                                Procces == 3
                                Actor.Animation(Mechanic) == "Car_wash_stay"
                            then
                                0613: 1@ = actor Mechanic animation "Car_wash_stay" time
                                if
                                    1@ > 0.6
                                then
                                    016A: fade 0 time 300
                                    wait 300
                                    0878: set_car Car_Actor dirt_level 0.0
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar13' time 3000 flag 1
                                    timerb = 0
                                end
                            end

                            if
                                Actor.Animation(Mechanic) == "Car_wash"
                            then
                                0393: actor Mechanic perform_animation "Car_wash" at 1.0 times_normal_rate
                            end
                            if
                                Actor.Animation(Mechanic) == "Car_wash_stay"
                            then
                                0393: actor Mechanic perform_animation "Car_wash_stay" at 1.1 times_normal_rate
                            end
                            
                            
                            //  -----------------------------------------------------------
                            if and
                                Procces == -1
                                Panel_active_row == 5
                                00E1:   player 0 pressed_key 16
                            then
                                if
                                    010A:   player $PLAYER_CHAR money > MONEY_COLOR
                                then
                                    08DA: remove_panel panel_1
                                    03E6: remove_text_box
                                    1@ = UI_X
                                    2@ = UI_Y
                                    1@ += 40.0
                                    0964: create_square_color_panel 'CARM1' position 1@ 2@ width 25.7 columns 8 interactive 1 background 1 alignment 1 panelID panel_1  // Colors
                                    0087: 4@ = 8@ // (float)
                                    4@ -= 1.0
                                    4@ *= -1.0
                                    068D: get_camera_position_to 1@ 2@ 3@
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset -2.0 4@ 1.0
                                    015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 0.0 0.0
                                    0160: set_camera_point_at 1@ 2@ 3@ switchstyle 1
                                    Procces = 300
                                    11@ = 0
                                    timera = 0
                                    timerb = 0
                                else
                                    00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                end
                            end
                            
                            if or
                                Procces == 300
                                Procces == 301
                            then
                                if
                                    00E1:   player 0 pressed_key 15
                                then
                                    08DA: remove_panel panel_1
                                        if
                                            Procces == 301
                                        then
                                            08A6: set_car Car_Actor door 3 rotation_to 0.0
                                        end
                                    Procces = 999
                                    gosub @panel_1
                                    wait 300
                                    continue
                                end
                                08D7: 11@ = panel panel_1 active_row
                                if and
                                    timera > 300
                                    00E1:   player 0 pressed_key 16
                                then
                                    timera = 0
                                    if
                                        Procces == 300
                                    then
                                        gosub @Color_Car
                                        0085: 24@ = 11@ // (int)
                                        08A6: set_car Car_Actor door 3 rotation_to 90.0
                                        0679: put_camera_on_car Car_Actor with_offset 4.0 -0.5 0.5 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 1
                                        Procces = 301
                                    else
                                        if
                                            Procces == 301
                                        then
                                            0085: 22@ = 11@ // (int)
                                            Procces = 302
                                        end
                                    end
                                end
                            end
                            
                            if
                                Procces == 302
                            then
                                016A: fade 0 time 300
                                wait 300
                                
                                09DB: set_panel panel_1 column 0 width 0
                                9@ = 0.1 //  
                                timera = 0
                                08A6: set_car Car_Actor door 3 rotation_to 0.0
                                0085: 1@ = MONEY_COLOR // (int)
                                1@ *= -1
                                0109: player $PLAYER_CHAR money += 1@
                                timerb = 0
                                0441: 1@ = car Car_Actor model
                                07E4: get_model 1@ dimensions_cornerA_to 2@ 2@ 2@ dimensions_cornerB_to 9@ 2@ 2@ // B
                                9@ += 1.0
                                0792: disembark_instantly_actor Mechanic
                                0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 9@ 0.0 0.5
                                00A1: put_actor Mechanic at 1@ 2@ 3@
                                0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                0174: 1@ = car Car_Actor Z_angle
                                1@ += 90.0
                                0173: set_actor Mechanic Z_angle_to 1@
                                064B: 10@ = create_particle "extinguisher" at 0.0 0.0 0.0 type 1
                                064C: make_particle 10@ visible
                                0812: AS_actor Mechanic perform_animation "Color_spray" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                0E31: set_render_object_visible Spray 1
                                0087: 1@ = 9@ // (float)
                                1@ -= 3.0
                                067C: put_camera_on_actor Mechanic offset 3.0 -1.0 0.5 rotation 0.0 1.0 0.0 tilt 0.0 switchstyle 2
                                Procces = 303
                                wait 100
                                
                                016A: fade 1 time 300
                                timerb = 0
                            end
                            
                            if and
                                Procces == 303
                                Actor.Animation(Mechanic) == "Color_spray"
                            then
                                0613: 1@ = actor Mechanic animation "Color_spray" time
                                if
                                    1@ > 0.2
                                then
                                    0D0B: get_actor Mechanic bone 24 matrix_pointer_to 1@ // IF and SET
                                    0D0A: store_coords_to 4@ 5@ 6@ from_matrix 1@ with_offsets 0.0 0.0 0.0
                                    0EC0: add_fx_system_particle 10@ coord 4@ 5@ 6@ vel 0.0 0.0 0.0 size 1.0 brightness 1.0 rgba 12@ 13@ 14@ 0.3 lastFactor 1.0
                                end
                                0613: 1@ = actor Mechanic animation "Color_spray" time
                                if
                                    1@ > 0.9
                                then
                                    0687: clear_actor Mechanic task
                                    9@ *= -1.0
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 9@ 0.0 0.5
                                    00A1: put_actor Mechanic at 1@ 2@ 3@
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0174: 1@ = car Car_Actor Z_angle
                                    1@ -= 90.0
                                    0173: set_actor Mechanic Z_angle_to 1@
                                    0812: AS_actor Mechanic perform_animation "Color_spray" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                    0614: set_actor Mechanic animation "Color_spray" progress_to 0.3 // 0.0 to 1.0
                                    0087: 1@ = 9@ // (float)
                                    1@ -= 3.0
                                    067C: put_camera_on_actor Mechanic offset -3.0 -0.0 0.5 rotation 0.0 1.0 0.0 tilt 0.0 switchstyle 2
                                    Procces = 304
                                    wait 100
                                    timerb = 0
                                end
                            end
                            
                            if and
                                Procces == 304
                                Actor.Animation(Mechanic) == "Color_spray"
                            then
                                0D0B: get_actor Mechanic bone 24 matrix_pointer_to 1@ // IF and SET
                                0D0A: store_coords_to 4@ 5@ 6@ from_matrix 1@ with_offsets 0.0 0.0 0.0
                                0EC0: add_fx_system_particle 10@ coord 4@ 5@ 6@ vel 0.0 0.0 0.0 size 1.0 brightness 1.0 rgba 12@ 13@ 14@ 0.3 lastFactor 1.0
                                0613: 1@ = actor Mechanic animation "Color_spray" time
                                if
                                    1@ > 0.9
                                then
                                    016A: fade 0 time 300
                                    wait 300
                                    0650: destroy_particle 10@
                                    0A22: set_car_color_to_panel_color_panelID panel_1 car Car_Actor colorslot 1 active_row 24@
                                    0A22: set_car_color_to_panel_color_panelID panel_1 car Car_Actor colorslot 2 active_row 22@
                                    08DA: remove_panel panel_1
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar14' time 3000 flag 1
                                    timerb = 0
                                end
                            end
                            
                            
                            
                            //  -----------------------------------------------------------
                            

                            if and
                                Procces == -1
                                Panel_active_row == 6
                                00E1:   player 0 pressed_key 16
                            then
                                0A97: 3@ = car Car_Actor struct
                                0D4E: 1@ = struct 3@ offset 0x8 size 1
                                if
                                    08B7:   test 1@ bit 1 //   
                                then
                                    03E6: remove_text_box
                                    08DA: remove_panel panel_1
                                    0A97: 3@ = car Car_Actor struct
                                    0D4E: 1@ = struct 3@ offset 0x9 size 4
                                    2@ = 1000
                                    0062: 2@ -= 1@  // (int)
                                    0D4E: 1@ = struct 3@ offset 0x8 size 1
                                    gosub @panel_2
                                    procces = 1488
                                    wait 300
                                else
                                    00BC: show_text_highpriority GXT 'rpcar32' time 2000 flag 1
                                end
                            end
                            
                            if and
                                Procces == 1488
                                00E1:   player 0 pressed_key 15
                            then
                                03E6: remove_text_box
                                08DA: remove_panel panel_1
                                gosub @panel_1
                                procces = -1
                                wait 300
                                continue
                            end
                            
                            0A97: 3@ = car Car_Actor struct
                            0D4E: 1@ = struct 3@ offset 0x9 size 4
                            2@ = 1000
                            0062: 2@ -= 1@  // (int)
                            if and
                                2@ > 0
                                010A:   player $PLAYER_CHAR money > 2@
                                Procces == 1488
                                00E1:   player 0 pressed_key 16
                            then
                                0A97: 1@ = car Car_Actor struct
                                0D4E: 1@ = struct 1@ offset 0x18 size 4
                                0AA7: call_function 0x4C5400 num_params 2 pop 2 "wheel_lb_dummy" 1@ 3@
                                if
                                    3@ <> 0 //  
                                then
                                    016A: fade 0 time 300
                                    wait 300
                                
                                    08DA: remove_panel panel_1
                                    03E6: remove_text_box
                                    2@ *= -1
                                    0109: player $PLAYER_CHAR money += 2@
                                    0A97: 1@ = car Car_Actor struct
                                    0E28: write_struct 1@ offset 0x9 size 4 value 1000
                                    0174: 11@ = car Car_Actor Z_angle
                                    3@ += 0x10
                                    //  
                                    0D4E: 5@ = struct 3@ offset 0x30 size 4
                                    0D4E: 6@ = struct 3@ offset 0x34 size 4
                                    0D4E: 12@ = struct 3@ offset 0x38 size 4

                                    5@ -= 0.8 //  
                                    12@ += 0.5
                                    0E5B: get_car_dummy_coord Car_Actor dummy 8 world_coords 0 invert_x 0 store_to 13@ 9@ 10@ // 8  -  
                                    0509: 2@ = distance_between_XY 13@ 9@ and_XY 5@ 6@
                                    if
                                        2@ > 1.5
                                    then
                                        5@ *= -1.0 //  ,   ,      
                                        11@ -= 180.0
                                    end
                                    0407: store_coords_to 2@ 3@ 4@ from_car Car_Actor with_offset 5@ 9@ 12@ //     X    Y
                                    11@ -= 90.0
                                    00A1: put_actor Mechanic at 2@ 3@ 4@
                                    0E31: set_render_object_visible GasPetrol 1
                
                                    0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                    0173: set_actor Mechanic Z_angle_to 11@
                                    timera = 0
                                    0619: enable_actor Mechanic collision_detection 0
                                    Procces = 0 // 
                                    0812: AS_actor Mechanic perform_animation "petrol" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                    
                                    04C4: store_coords_to 1@ 2@ 3@ from_actor Mechanic with_offset 1.0 0.5 0.5
                                    04C4: store_coords_to 4@ 5@ 6@ from_actor Mechanic with_offset 0.0 0.0 0.5
                                    015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                                    0160: set_camera_point_at 4@ 5@ 6@ switchstyle 2

                                    wait 500
                                    
                                    016A: fade 1 time 300

                                    12@ = 1.0
                                    13@ = 0.5
                                    9@ = 0.5
                                    timerb = 0

                                    repeat
                                    wait 0
                                    if
                                        856E:   not car Car_Actor defined
                                    then
                                        break
                                    end
                                        //  
                                        if
                                            056D:   actor Mechanic defined
                                        then
                                            if and
                                            Procces == 0
                                            timera > 500
                                        then
                                            12@ += 0.001
                                            13@ -= 0.001
                                            9@ -= 0.001
                                            04C4: store_coords_to 1@ 2@ 3@ from_actor Mechanic with_offset 12@ 9@ 13@
                                            04C4: store_coords_to 4@ 5@ 6@ from_actor Mechanic with_offset 0.0 0.0 13@
                                            015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                                            0160: set_camera_point_at 4@ 5@ 6@ switchstyle 2
                                        if or
                                            timerb > 5000
                                            12@ > 1.2
                                        then
                                            Procces = 1
                                            timera = 0
                                            04C4: store_coords_to 1@ 2@ 3@ from_actor Mechanic with_offset -5.0 0.0 -0.4
                                            04C4: store_coords_to 4@ 5@ 6@ from_actor Mechanic with_offset 0.0 0.0 0.0
                                            015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                                            0160: set_camera_point_at 4@ 5@ 6@ switchstyle 2
                                            12@ = -5.0
                                            13@ = -0.4
                                            9@ = 0.0
                                            timerb = 0
                                        end
                                    end
                                    
                                if
                                    Procces == 1
                                then
                                    12@ += 0.004
                                    13@ += 0.006
                                    9@ += 0.002
                                    04C4: store_coords_to 1@ 2@ 3@ from_actor Mechanic with_offset 12@ 9@ 13@
                                    04C4: store_coords_to 4@ 5@ 6@ from_actor Mechanic with_offset 0.0 0.0 0.0
                                    015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                                    0160: set_camera_point_at 4@ 5@ 6@ switchstyle 2
                                    if or
                                        timerb > 5000
                                        12@ > -3.5
                                    then
                                        016A: fade 0 time 500
                                        if or
                                            timerb > 6000
                                            12@ > -3.0
                                        then
                                            Procces = 2
                                        end
                                    end
                                end
                                
                                    if
                                        Procces == 2
                                    then
                                        016A: fade 0 time 0
                                        wait 100
                                        break
                                    end
                                else
                                    break
                                end
                                until not player.Defined(0)
                                    016A: fade 0 time 300
                                    
                                    wait 150
                                    068D: get_camera_position_to 1@ 2@ 3@
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset -2.0 4@ 1.0
                                    015F: set_camera_position 1@ 2@ 3@ rotation 0.0 0.0 0.0
                                    0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 0.0 0.0 0.0
                                    0160: set_camera_point_at 1@ 2@ 3@ switchstyle 1
                                    wait 150
                                    Procces = 999
                                    gosub @panel_1
                                    00BC: show_text_highpriority GXT 'rpcar31' time 3000 flag 1
                                    timerb = 0
                                    continue
                                else
                                    0AD1: show_formatted_text_highpriority "Component not detected: bonnet_dummy" time 2000
                                end
                            else
                                if and
                                    Procces == 1488
                                    00E1:   player 0 pressed_key 16
                                    2@ <= 0
                                then
                                    00BC: show_text_highpriority GXT 'rpcar30' time 2000 flag 1
                                end
                                if and
                                    Procces == 1488
                                    00E1:   player 0 pressed_key 16
                                    810A:   not player $PLAYER_CHAR money > 2@
                                then
                                    00BC: show_text_highpriority GXT 'rpcar3' time 2000 flag 1
                                end
                            end
                            
                            
                            //    -       ,   
                            if and
                                not procces == -1 //  
                                not procces == 300 //   1
                                not procces == 301 //   2
                                not procces == 1488
                                timerb > 20000
                            then
                                procces += 1
                                timerb = 0
                            end

                            //  -----------------------------------------------------------
                            if
                                Procces == 999
                            then
                                0792: disembark_instantly_actor Mechanic
                                0407: store_coords_to 1@ 2@ 3@ from_car Car_Actor with_offset 2.0 7@ 1.0
                                00A1: put_actor Mechanic at 1@ 2@ 3@
                                0E24: fix_char Mechanic ground 1 brightness 1 and_fade_in 0
                                0174: 1@ = car Car_Actor Z_angle
                                1@ += 90.0
                                0173: set_actor Mechanic Z_angle_to 1@
                                0E31: set_render_object_visible Spanner 0
                                0E31: set_render_object_visible Sponge 0
                                0E31: set_render_object_visible Drill 0
                                0E31: set_render_object_visible Spray 0
                                0E31: set_render_object_visible GasPetrol 0
                                Procces = -1
                                0679: put_camera_on_car Car_Actor with_offset -2.0 8@ 1.0 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2
                                0812: AS_actor Mechanic perform_animation "Washer_Idle" IFP "RuralRepair" framedelta 10.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1
                                wait 100
                                timerb = 0
                                016A: fade 1 time 300
                            end
                        else //      
                    break
                end
                
                    until not player.Defined(0) //     
                        08DA: remove_panel panel_1
                        03E6: remove_text_box
                        02EB: restore_camera_with_jumpcut
                        04EF: release_animation "RuralRepair"
                        if 056D:   actor Mechanic defined
                        then 009B: destroy_actor Mechanic
                        end
                        if 056E:   car Car_Actor defined
                        then 0ABF: set_car Car_Actor engine_state_to 1
                        end
                        016A: fade 1 time 1000
                        0826: enable_hud 1
                        0581: enable_radar 1
                        03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
                        01B4: set_player $PLAYER_CHAR can_move 1
                        
                        0A93: terminate_this_custom_script
                        
            else //     
            
                //     
                if or
                    10@ == false
                    not 1@ == 0
                then
                    0209: 1@ = random_int_in_ranges 1 4
                        if 1@ == 1
                    then
                        00BC: show_text_highpriority GXT 'rpcar8' time 3000 flag 1
                    end
                        if 1@ == 2
                    then
                        00BC: show_text_highpriority GXT 'rpcar18' time 3000 flag 1
                    end
                        if 1@ == 3
                    then
                        00BC: show_text_highpriority GXT 'rpcar19' time 3000 flag 1
                    end
                end
                
                //     
                if and
                    4@ == true
                    010F:   player $PLAYER_CHAR wanted_level > 0
                then
                    0209: 1@ = random_int_in_ranges 1 4
                        if 1@ == 1
                    then
                        00BC: show_text_highpriority GXT 'rpcar9' time 3000 flag 1
                    end
                        if 1@ == 2
                    then
                        00BC: show_text_highpriority GXT 'rpcar20' time 3000 flag 1
                    end
                        if 1@ == 3
                    then
                        00BC: show_text_highpriority GXT 'rpcar21' time 3000 flag 1
                    end
                        if 1@ == 4
                    then
                        00BC: show_text_highpriority GXT 'rpcar25' time 3000 flag 1
                    end
                end
                
                //      
                0E40: get_current_hour 2@
                if and
                    4@ == true
                    2@ < 6
                then
                    0209: 1@ = random_int_in_ranges 1 5
                        if 1@ == 1
                    then
                        00BC: show_text_highpriority GXT 'rpcar10' time 3000 flag 1
                    end
                        if 1@ == 2
                    then
                        00BC: show_text_highpriority GXT 'rpcar22' time 3000 flag 1
                    end
                        if 1@ == 3
                    then
                        00BC: show_text_highpriority GXT 'rpcar23' time 3000 flag 1
                    end
                        if 1@ == 4
                    then
                        00BC: show_text_highpriority GXT 'rpcar24' time 3000 flag 1
                    end
                end
                
                0A93: terminate_this_custom_script
            end
        end
    end
end


:Color_Car
//      ,      
12@ = 0.4
13@ = 0.4
14@ = 0.4

    // 
    if or
        11@ == 3
        11@ == 16
        11@ == 30
        11@ == 31
    then
        12@ = 0.6
        13@ = 0.0
        14@ = 0.0
    end
    
    // 
    if or
        11@ == 5
        11@ == 17
        11@ == 19
        11@ == 20
        11@ == 46
        11@ == 61
    then
        12@ = 1.0
        13@ = 0.5
        14@ = 0.5
    end

    // 
    if or
        11@ == 2
        11@ == 7
        11@ == 10
        11@ == 38
        11@ == 22
        11@ == 36
        11@ == 37
    then
        12@ = 0.0
        13@ = 0.0
        14@ = 0.7
    end
    if or
        11@ == 44
        11@ == 50
        11@ == 51
        11@ == 53
        11@ == 54
        11@ == 25
    then
        12@ = 0.0
        13@ = 0.0
        14@ = 0.5
    end
    
    // /
    if or
        11@ == 1
        11@ == 8
        11@ == 9
        11@ == 13
        11@ == 14
        11@ == 18
        11@ == 23
    then
        12@ = 0.8
        13@ = 0.8
        14@ = 0.8
    end
    if or
        11@ == 24
        11@ == 25
        11@ == 26
        11@ == 29
        11@ == 34
    then
        12@ = 0.8
        13@ = 0.8
        14@ = 0.8
    end
    
    // /
    if or
        11@ == 0
        11@ == 4
        11@ == 12
        11@ == 21
        11@ == 27
        11@ == 28
        11@ == 62
    then
        12@ = 0.2
        13@ = 0.2
        14@ = 0.2
    end
    if
        11@ == 63
    then
        12@ = 0.2
        13@ = 0.2
        14@ = 0.2
    end
    
    // 
    if or
        11@ == 15
        11@ == 47
        11@ == 51
        11@ == 32
        11@ == 35
        11@ == 57
    then
        12@ = 0.0
        13@ = 0.6
        14@ = 0.0
    end
        // 
    if or
        11@ == 6
        11@ == 39
        11@ == 40
    then
        12@ = 0.6
        13@ = 0.6
        14@ = 0.0
    end
return


:Panel_1
08D4: panel_1 = create_panel_with_title 'rpcar49' position UI_X UI_Y width 200.0 columns 2 interactive 1 background 1 alignment 1  // Imports
09DB: set_panel panel_1 column 0 width 200
09DB: set_panel panel_1 column 1 width 70
08DB: set_panel panel_1 column 0 header 'rpcar57' data 'rpcar50' 'rpcar51' 'rpcar64' 'rpcar59' 'rpcar52' 'rpcar53' 'rpcar54' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
08DB: set_panel panel_1 column 1 header 'rpcar56' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
08EE: set_panel panel_1 column 1 row 0 text_1number GXT 'rpcar2' number MONEY_TIRE
08EE: set_panel panel_1 column 1 row 1 text_1number GXT 'rpcar2' number MONEY_REPAIR
08EE: set_panel panel_1 column 1 row 2 text_1number GXT 'rpcar2' number money_body
08EE: set_panel panel_1 column 1 row 3 text_1number GXT 'rpcar2' number money_full
08EE: set_panel panel_1 column 1 row 4 text_1number GXT 'rpcar2' number MONEY_WASH
08EE: set_panel panel_1 column 1 row 5 text_1number GXT 'rpcar2' number MONEY_COLOR
Panel_active_row = 0
090E: set_panel panel_1 active_row Panel_active_row
0512: show_permanent_text_box 'rpcar58'  // 
return

:Panel_2
08D4: panel_1 = create_panel_with_title 'rpcar49' position UI_X UI_Y width 200.0 columns 2 interactive 1 background 1 alignment 1  // Imports
09DB: set_panel panel_1 column 0 width 200
09DB: set_panel panel_1 column 1 width 70
08DB: set_panel panel_1 column 0 header 'rpcar57' data 'rpcar63' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
08DB: set_panel panel_1 column 1 header 'rpcar56' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'
08EE: set_panel panel_1 column 1 row 0 text_1number GXT 'rpcar2' number 2@
Panel_active_row = 0
090E: set_panel panel_1 active_row Panel_active_row
0512: show_permanent_text_box 'rpcar58'  // 
return

